fix(hooks): close Qwen Code hooks gaps (events, http, sequential/disableAllHooks) - #1951
Merged
Merged
Conversation
…bleAllHooks) Add the three Qwen-specific hook events as canonical events and preserve the `http` transport plus the group-level `sequential` and top-level `disableAllHooks` switches on both import and export. - Add canonical `todoCreated`, `todoCompleted`, and `stopFailure` events and map them in `QWENCODE_HOOK_EVENTS` / `CANONICAL_TO_QWENCODE_EVENT_NAMES`. Other tool adapters filter `config.hooks` against their own supported-event set, so the new canonical events are only emitted by Qwen Code. - Preserve the `http` hook type and its `url` field on import instead of collapsing every non-command/prompt hook to `command`. Add `url` to the canonical `HookDefinitionSchema`. - Round-trip the per-matcher-group `sequential` flag (stored per definition) and the top-level `disableAllHooks` switch (under the `qwencode` namespace). - Keep copilotcli's `http` url passthrough working now that `url` is canonical. - Extend unit tests and synchronize docs/skills. Closes #1925 Ref: #1888 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Owner
Author
|
@dyoshikawa Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the three Qwen Code hooks gaps reported in #1925.
Issue: #1925
Ref: #1888
Changes
1. Missing events
TodoCreated,TodoCompleted,StopFailuretodoCreated,todoCompleted, andstopFailureto theHookEventunion insrc/types/hooks.ts.QWENCODE_HOOK_EVENTSandCANONICAL_TO_QWENCODE_EVENT_NAMES(⇄
TodoCreated/TodoCompleted/StopFailure).config.hooksagainst its own*_HOOK_EVENTSset (supported.has(event)), and unknown event names fallback via
?? eventName. The new canonical events are therefore only emittedby Qwen Code; no other tool adapter changes behavior. Confirmed by reading the
shared
tool-hooks-converter.tsand theclaudecode/copilotcli/copilotadapters, and by the full test suite passing.2.
httphook type was lossy on importqwencodeHooksToCanonicalpreviously coerced any non-command/prompt hook(including
http) tocommand, dropping the transport. It now preserveshttpand its targeturl.urlfield to the canonicalHookDefinitionSchemaso the URLround-trips, and updated
copilotcli-hooks.tsto keep passingurlthroughfor its
httpexport now thaturlis a canonical (no longer passthrough) key.3. Group-level
sequentialand top-leveldisableAllHooksnot round-trippedQwencodeMatcherEntrySchemanow readssequential(per matcher group), storedper canonical definition and re-emitted when any definition in a group opts in
(Qwen defaults to parallel, so it is only written when
true).disableAllHooksis captured into theqwencodenamespace on import andwritten back to
.qwen/settings.jsonon export.Tests
qwencode-hooks.test.ts: generate + import round-trip for the threenew events,
httptype/url preservation on import and export, andsequential/disableAllHooksround-trip.e2e-hooks.spec.ts, 52passing).
docs/reference/file-formats.mdand the generatedskills/rulesync/file-formats.md.Verification
Full
pnpm cicheck(code + content) is green: oxfmt, oxlint, tsgo typecheck,6743 unit tests, skill-doc-sync, cspell (0 issues), secretlint.
🤖 Generated with Claude Code